package net.xiduth.game.player.content;


/**
 * @author Jae
 * Converted to Xiduth format.
 */

 public class Lottery { 
 	} 
 
 
 /* extends TasksManager { 

	public static ArrayList<Player> attendents = new ArrayList<Player>();
	
	public static int LOTTERY_TOTAL = 0;
	
	private static final int REQUIRED_MONEY = 5000000;
	
	private boolean registered;
	
	private int hosting = 10;
	
	public Lottery() {
		super(200);
	}

	@Override
	public void process() {
			TasksManager.schedule(new Task() {
	@Override
	public void run() {
		int winner = Misc.random(attendents.size());
		if (World.getPlayers().size() < 1) {
			return;
		}
		if (attendents.size() < 1) {
			sendWorldMessage("[Lottery] No one has entered the lottery!");
			return;
		}
		if (hosting <= 0) {
			sendWorldMessage("[Lottery] The lottery has ended!");
			sendWorldMessage("[Lottery] The winning lottery player is..."+attendents.get(winner).getUsername()+"!");
			resetLottery();
		}
		hosting--;
	}
			}
	}
	
	public void addToLottery(Player player) {
		int cashAmount = player.getInventory().numberOf(995);
		if (!player.getInventory().containsOneItem(995)) {
			player.sendMessage("You don't have any money.");
			return;
		}
		if (cashAmount < REQUIRED_MONEY) {
			player.sendMessage("You don't have that much.");
			return;
		}
		player.getInventory().deleteItem(995, REQUIRED_MONEY);
		LOTTERY_TOTAL += REQUIRED_MONEY;
		if (!player.getLottery().isRegistered()) {
			player.getLottery().setIsRegistered(true);
			registerAttendent(player);
		}
		sendWorldMessage("[Lottery] The current lottery pot is now " + LOTTERY_TOTAL + ".");
	}
	
	private void resetLottery() {
		for (Player p : attendents) {
			p.getLottery().setIsRegistered(false);
		}
		attendents.clear();
		hosting = 10;
		LOTTERY_TOTAL = 0;
		stop();
	}
	
	public void registerAttendent(Player player) {
		if (isRunning()) {
			attendents.add(player);
		} else {
			attendents.add(player);
			start();
		}
	}
	
	private void sendWorldMessage(String message) {
		for (Player players : World.getPlayers()) {
			if (players == null)
				continue;

			players.sendMessage(message);
		}
	}
	
	public boolean isRegistered() {
		return registered;
	}
	
	public void setIsRegistered(boolean bool) {
		this.registered = bool;
	}
	
} */